package com.gdwhomework.chapter07.homework006;

public class Teacher extends Person{
    private int work_age;//工龄

    public Teacher(String name, char gender, int age, int work_age) {
        super(name, gender, age);
        this.work_age = work_age;
    }

    public int getWork_age() {
        return work_age;
    }

    public void setWork_age(int work_age) {
        this.work_age = work_age;
    }

    @Override
    public String play() {
        return super.play()+"象棋";
    }

    public void teach(){
        System.out.println("我承诺，我会认真教学。");
    }

    @Override
    public void showinfo() {
        System.out.println("老师的信息：");
        super.showinfo();
        System.out.println("工龄："+getWork_age());

    }
}
